package top.banner.es;

import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;

import java.io.IOException;

/**
 * @author XGL
 */
public class DocDelete {

    public static void main(String[] args) throws IOException {
        final RestHighLevelClient client = ESClient.init();

        final DeleteRequest request = new DeleteRequest();
        request.index("user").id("1001");

        final DeleteResponse response = client.delete(request, RequestOptions.DEFAULT);

        System.out.println(response.getResult());

        client.close();
    }
}
